package com.campus_activity.campus_activity.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.campus_activity.campus_activity.domain.po.Activity;
import com.campus_activity.campus_activity.domain.vo.ActivityDetailVO;
import com.campus_activity.campus_activity.domain.vo.ActivityImgVO;
import com.campus_activity.campus_activity.domain.vo.ActivityVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;


/**
 * @author 73493
 * @description 针对表【t_activity(活动表)】的数据库操作Mapper
 * @createDate 2023-04-24 17:03:48
 * @Entity com.campus_activity.campus_activity.pojo.Activity
 */
@Mapper
public interface ActivityMapper extends BaseMapper<Activity> {


    /**
     * 分页查询活动
     *
     * @param page
     * @return
     */
    List<ActivityVO> listActivity(IPage<ActivityVO> page, String activityName);


    /**
     * 通过id获取活动详情
     *
     * @param id
     * @return
     */
    ActivityDetailVO getActivityDetailById(@Param("id") Long id);

    /**
     * 乐观锁更新
     *
     * @param activityId
     * @return
     */
    boolean updateById(Long activityId);


    /**
     * 查询用户发布的活动历史记录
     * @param page
     * @param activityName
     * @param userId
     * @return
     */
    List<ActivityVO> listActivityPublishHistory(IPage<ActivityVO> page, String activityName, Long userId);

    /**
     * 查询历史参与的活动记录
     * @param page
     * @param userId
     * @param activityName
     * @return
     */
    List<ActivityVO> listActivityHistory(IPage<ActivityVO> page, Long userId, String activityName);
}
